<template>
	<el-input class="textBoxShort" size="small" v-model="value" :disabled="isReadOnly" clearable placeholder=""></el-input>
</template>

<script>
	export default {
		name: "f2bpmui-textbox",
		props: ['field', 'fieldvalue'],
		watch: {
			fieldvalue: {
				handler(newVal, oldVal) {
					if (newVal != this.value && newVal != oldVal && oldVal != undefined) {
						this.value = newVal;
					}
				},
				deep: true,
				immediate: false
			},
			value(val, oldVal) {
				var that = this;
				if (val != undefined) {
					this.$emit('updatevalue', that.field.field, val)
				}
			}
		},
		created: function() {
			var that = this;
			that.value = that.fieldvalue;

		},
		data: function() {
			return {
				isReadOnly: false,
				value: ''
			}
		},
		methods: {}
	};
</script>
